<html>
    <meta charset="UTF-8">
    <head>
        <title>
            H5测试
        </title>
    </head>
    <body>
        <h1 align="center">标题1（App调用Js使标题变成红色）</h1>
        <script>
             //js调用APP-传单个参数
             function callNativeApp(){
                try{
                    webkit.messageHandlers.callbackHandle.postMessage("Hello World")
                }catch(error){
                    console.error('The native context not exist ')
                }
            }
            //js调用APP-传多个参数
            function callNativeApp2(){
                try{
                    webkit.messageHandlers.callbackHandle2.postMessage({key: "Hello", value: "World"})
                }catch(error){
                    console.error('The native context not exist ')
                }
            }
            //APP调用js
            function changeHead(){
                document.querySelector('h1').style.color = "red"
            }
            </script>

            <button style="text-align:center;height:50px;width:200px;font-size:16px" onclick="callNativeApp()">调用APP（单个参数）</button>
            
            <button style="text-align:center;height:50px;width:220px;font-size:16px" onclick="callNativeApp2()">调用APP（多个个参数）</button>
    </body>
</html>


